import React, { Component } from 'react'
import "./index.scss"
function ListCard(props) {
    const [state, setState] = React.useState({
        color: 1 //0表示按下  1表示抬起
    });
    function mouseDown() {
        console.log('鼠标按下');
        setState({
            color: 0
        })
        setTimeout(() => { setState({ color: 1 }) }, 100)
    }

    // function mouseUp() {
    //     console.log('鼠标抬起');
    //     setState({
    //         color: 0
    //     })
    // }


    return (
        <div className={state.color == 0 ? 'bcg tag' : 'tag'} onMouseDown={mouseDown.bind(this)} >
            <i className="iconfont">{props.icon}</i>
            <div className="title">
                <span>{props.title}</span>
            </div>
            <div className="content">
                <span>{props.children}</span>
            </div>
            <i className="iconfont">&#xe622;</i>
        </div>
    )
}
export default ListCard